from sakucrm import models
from stack.service.stack import StackConfig
from stack.service.stack import get_choice_text
from stack.service.stack import Option
from django import forms
from django.shortcuts import HttpResponse
from django.conf import settings
from django.db import transaction

class StudentConfig(StackConfig):
    '''
    学生信息
    '''
    def display_class_list(self,row=None,header=False):
        if header:
            return '班级'
        class_list=row.class_list.all()
        class_name_list=["{}-{}期".format(item.course.name,item.semester) for item in class_list]
        return ''.join(class_name_list)
    list_display = ['username','customer',display_class_list]